﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace D3Calc
{
    public partial class BattleNet : Form
    {
        public BattleNet()
        {
            InitializeComponent();
        }

        private void btnGet_Click(object sender, EventArgs e)
        {
            string tag = txtTag.Text;
            if (string.IsNullOrEmpty(tag))
            {
                MessageBox.Show("请先输入战网Tag");
                return;
            }

            string bn = "tw";
            if (rdbEU.Checked) bn = "eu";
            else if (rdbKR.Checked) bn = "kr";
            else if (rdbUS.Checked) bn = "us";
            else bn = "tw";

            Profile profile = new Profile(tag, bn);
            ProfileLoaded(profile);

            this.Close();
        }

        public delegate void LoadProfile(Profile profile);
        public LoadProfile ProfileLoaded;
    }
}
